package com.softwarerusher.action;

import java.util.List;
import java.util.Map;

import org.apache.struts2.interceptor.RequestAware;
import org.apache.struts2.interceptor.SessionAware;

import com.opensymphony.xwork2.ActionSupport;
import com.softwarerusher.daoImpl_cym.TCategoryDAO;
import com.softwarerusher.model.TBook;
import com.softwarerusher.model.TCategory;

public class netshopallcategory extends ActionSupport implements RequestAware,SessionAware{

    private Map<String,Object> request;
    private Map<String,Object> session;
    private List<TCategory> categoryList;
    private List<TCategory> categoryList1;
    private List<TCategory> categoryList2;
	public String allcategory()
	{
		TCategoryDAO categorydao = new TCategoryDAO();
		categoryList = categorydao.findAll();
        categoryList1 = categoryList.subList(0, 20);
        categoryList2 = categoryList.subList(21, categoryList.size()-1);
		return "success";
	}
	public List<TCategory> getCategoryList() {
		return categoryList;
	}

	public void setCategoryList(List<TCategory> categoryList) {
		this.categoryList = categoryList;
	}


	
	public Map<String, Object> getRequest() {
		return request;
	}
	public void setRequest(Map<String, Object> request) {
		this.request = request;
	}
	public Map<String, Object> getSession() {
		return session;
	}
	public void setSession(Map<String, Object> session) {
		this.session = session;
	}
	public List<TCategory> getCategoryList1() {
		return categoryList1;
	}
	public void setCategoryList1(List<TCategory> categoryList1) {
		this.categoryList1 = categoryList1;
	}
	public List<TCategory> getCategoryList2() {
		return categoryList2;
	}
	public void setCategoryList2(List<TCategory> categoryList2) {
		this.categoryList2 = categoryList2;
	}

}
